package com.mfin.bs.services;

import com.mfin.bs.mgr.impl.TransactionManager;
import com.mfin.bs.mgr.interfaces.IChitFinanceManager;
import com.mfin.bs.mgr.interfaces.IFinanceInformationManager;
import com.mfin.bs.mgr.interfaces.ITransactionManager;
import com.mfin.vo.chits.ChitMasterApplicationVO;
import com.mfin.vo.chits.ChitMasterVO;
import com.mfin.vo.chits.FinanceChitApplicantListVO;
import com.mfin.vo.finance.FinanceVO;
import com.mfin.vo.loan.FinanceLoanVO;

public class ChitFinanceServicesImpl extends BaseImpl implements
		IChitFinanceServices {

	@Override
	public ChitMasterVO createFinanceChit(FinanceVO financeVO,
			ChitMasterApplicationVO chitMasterApplicationVO, FinanceChitApplicantListVO financeChitApplicantListVO) {
		ITransactionManager transaction = new TransactionManager();
		transaction.beginTransaction();

		IFinanceInformationManager financeInformationManager = getFinanceManager(transaction
				.getPersistenceGovernor());
		IChitFinanceManager chitFinanceManager = getChitFinanceManager(transaction
				.getPersistenceGovernor());
		ChitMasterVO chitMasterVO = financeInformationManager.createChitMaster(
				financeVO, chitMasterApplicationVO);

		transaction.commitTransaction();
		return chitMasterVO;
	}

}
